Geometry: Contextual
- Geometry(EntityName)
Obtains an entity given its name
- Parameters:
EntityName (str) – Entity name.
- GeometryModelGroup(GroupName)
Obtains a group given its name
- Parameters:
GroupName (str) – Group name.
- geomExplode(entity, Geom)
Explode: Explode the selected geometry in order to its components are editable
Alias: explode- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Enumerate – { VERTEX, EDGE, WIRE, FACE, SHELL, VOLUME, BODY, GROUP, ENTITY } Geom: Sub-Geom: Topology of the geometry entities.
Example:
# -*- coding: utf-8 -*-
# Example: Exploding a geometric entity into its sub-elements
# This command decomposes a geometric entity into its constituent
# sub-geometries (e.g., vertices, edges, or faces).
#
# The second argument determines the type of subgeometry to extract:
# - "VERTEX" : Extracts the corner points of the geometry.
# - "EDGE" : Extracts the boundary curves.
# - "WIRE" : Extracts the groups of curves.
# - "FACE" : Extracts the surface faces.
# - "SHELL" : Extracts the shells.
# - "VOLUME" : Extracts the volumes.
#
# The result is a list of new geometric entities representing the
# requested sub-elements.
# Create a sample surface (quadrilateral) to work with
quad_geom_entity = createQuad(
"Surface",
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)
)
# Explode the surface into its vertices
sub_geoms = geomExplode([quad_geom_entity], "VERTEX")
# Result:
# sub_geoms is a list of point entities corresponding to the four vertices
# of the quadrilateral surface.
- mirror(entity, Axis)
Axis: Axial reflection of the geometric entity
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Axis (POCCGeomLine) – Axis: Axis of symmetry. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
- mirror(entity, Pnt)
Axis: Axial reflection of the geometric entity
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Pnt (POCCVertexByCoord) – Point: Point of symmetry. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
- mirror(entity, GeomName, Axis)
Axis: Axial reflection of the geometric entity
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
GeomName (str) – Name. Conditions: “” input must be non-empty.
Axis (POCCGeomLine) – Axis: Axis of symmetry. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
- mirror(entity, Copy, Plane)
Axis: Axial reflection of the geometric entity
Constraints: 3 dimensions- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Copy (bool) – Copy: Create a copy of the geometry.
Plane (POCCQuad) – Plane: Plane of symmetry. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
- mirror(entity, GeomName, Pnt)
Axis: Axial reflection of the geometric entity
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
GeomName (str) – Name. Conditions: “” input must be non-empty.
Pnt (POCCVertexByCoord) – Point: Point of symmetry. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
- mirror(entity, Copy, GeomName, Plane)
Plane: Reflection through a plane of the geometric entity
Constraints: 3 dimensions- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Copy (bool) – Copy: Create a copy of the geometry.
GeomName (str) – Name. Conditions: “” input must be non-empty.
Plane (POCCQuad) – Plane: Plane of symmetry. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
- mirror(entity, Copy, PointPlane, VectorPlane)
Plane: Reflection through a plane of the geometric entity
Constraints: 3 dimensions- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Copy (bool) – Copy: Create a copy of the geometry.
PointPlane – Point of plane: Point of the plane of symmetry.
VectorPlane – Normal vector of plane: Normal vector of the plane of symmetry.
Example:
# -*- coding: utf-8 -*-
# Example: Mirroring a geometric entity about an axis
# In this example, a geometric entity (an axis) is duplicated by mirroring it
# with respect to another axis that acts as the mirror plane.
# --- Create the entity to be mirrored ---
origin = Point(1, 0, 0) # Origin point of the axis to be copied
direction = Vector(1, 0, 0) # Direction vector of the axis to be copied
geom_entity_to_copy = createAxis(
"Curve", # Name of the original axis entity
origin, # Origin point
direction # Axis direction
)
# --- Create the mirror axis ---
# This axis defines the position and orientation of the mirror plane.
origin = Point(0, 0, 0) # Origin point of the mirror axis
direction = Vector(1, 0, 0) # Direction vector of the mirror axis
axis_mirror_geom_entity = createAxis(
"Curve (mirror)", # Name of the mirror axis entity
origin, # Origin point
direction # Axis direction
)
# --- Perform the mirror operation ---
# The 'mirror' command creates a mirrored copy of the specified entity
# with respect to the given axis.
mirror(
[geom_entity_to_copy], # List of entities to mirror
"Copy of Curve", # Name of the mirrored entity
axis_mirror_geom_entity # Axis used as the mirror reference
)
- move(entity, FirstPoint, SecondPoint)
Point to point: Translate the geometric entity from one point to another
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
FirstPoint (Entity) – Point1: First point of translation vector. Conditions: The input must be non-empty. “” does not exist in the dropdown list. Points can not match.
SecondPoint (Entity) – Point2: Second point of translation vector. Conditions: The input must be non-empty. “” does not exist in the dropdown list. Points can not match.
- move(entity, GeomName, FirstPoint, SecondPoint)
Point to point: Translate the geometric entity from one point to another
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
GeomName (str) – Name. Conditions: “” input must be non-empty.
FirstPoint (Entity) – Point1: First point of translation vector. Conditions: The input must be non-empty. “” does not exist in the dropdown list. Points can not match.
SecondPoint (Entity) – Point2: Second point of translation vector. Conditions: The input must be non-empty. “” does not exist in the dropdown list. Points can not match.
- move(entity, DX, DY, DZ)
Point to point: Translate the geometric entity from one point to another
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
DX (Double) – DX: X component of translation vector.
DY (Double) – DY: Y component of translation vector.
DZ (Double) – DZ: Z component of translation vector.
- move(entity, Copy, Independent, DX, DY, DZ)
Vector: Translate the geometric entity following a vector
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Copy (bool) – Copy: Create a copy of the geometry.
Independent (bool) – Independent: Create a copy not referenced to current geometric entity.
DX (Double) – DX: X component of translation vector.
DY (Double) – DY: Y component of translation vector.
DZ (Double) – DZ: Z component of translation vector.
- move(entity, GeomName, Copy, Independent, DX, DY, DZ)
Vector: Translate the geometric entity following a vector
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
GeomName (str) – Name. Conditions: “” input must be non-empty.
Copy (bool) – Copy: Create a copy of the geometry.
Independent (bool) – Independent: Create a copy not referenced to current geometric entity.
DX (Double) – DX: X component of translation vector.
DY (Double) – DY: Y component of translation vector.
DZ (Double) – DZ: Z component of translation vector.
Example:
# -*- coding: utf-8 -*-
# Example: Moving a geometric entity from one point to another
# This command creates a copy of a geometric entity translated from a starting point
# to an end point. The original entity remains unchanged, and a new entity is generated
# with the specified translation.
# Create the geometry to move (e.g., a quad surface)
object_geom_entity = createQuad(
"Surface",
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)
)
# Define the starting point of the translation
starting_point_geom_entity = createPoint("Point", Point(0, 0, 0))
# Define the end point of the translation
end_point_geom_entity = createPoint("Point (2)", Point(0, 0, 1))
# Perform the translation operation
move(
[object_geom_entity], # List of entities to move
"Copy of Surface", # Name of the resulting moved entity
starting_point_geom_entity, # Starting point of the translation
end_point_geom_entity # End point of the translation
)
# Result:
# A copy of the original quad surface is created, moved from the starting point
# to the end point. The original entity remains unchanged.
- multiRotation(entity, Axis, Angle, NumTimes)
Multiple copy: Creates multiple copies rotating the geometric entity
Alias: multiR- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Axis (Entity) – Axis: Axis of rotation. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
Angle (Double) – Angle: Angle of rotation. Conditions: Value must be greater than 0.
NumTimes (int) – Rotations: Number of times that the geometric entity will be rotated. Conditions: Value must be greater than 0.
Example:
# -*- coding: utf-8 -*-
# Example: Rotating a geometry multiple times around an axis
# This command performs one or multiple rotations of a given geometry
# around a specified axis by a defined angle. It can be used to create
# repeated patterns or symmetrical geometries through rotational duplication.
# Arguments:
# 1. List: Entities to rotate (e.g., surfaces, curves, solids).
# 2. Axis entity: The geometric axis used as the center of rotation.
# 3. Double: Rotation angle in degrees for each step.
# 4. Integer: Number of rotations to apply.
# Geometry to rotate
quad_geom_entity = createQuad(
"Surface",
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)
)
# Axis of rotation
axis_geom_entity = createAxis("Curve", Point(0, 0, 0), Vector(1, 0, 0))
# Rotation parameters
rotAngle = Double(90) # Rotation angle per instance (in degrees)
num_rotations = 1 # Number of rotations or instances to generate
# Execute the multi-rotation
multiRotation(
[quad_geom_entity],
axis_geom_entity,
rotAngle,
num_rotations
)
# Result:
# A rotated copy (or multiple copies) of the original geometry is created
# around the specified axis, according to the given rotation angle and count.
- multiTranslate(entity, DirU, NumTimesDirU, Independent)
Multiple copy: Creates multiple copies traslating the geometric entity
Alias: multiTr- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
DirU (Vector) – Vector 1: First vector to define the translation. Conditions: A vector cannot have zero magnitude.
NumTimesDirU (int) – Number 1: Number of translations to be done along the first direction. Conditions: Value must be greater than 0.
Independent (bool) – Independent: Create a copy not referenced to current geometric entity.
Example:
# -*- coding: utf-8 -*-
# Example: Performing multiple translations of a geometry along a single direction
# This command creates multiple translated copies of a given geometry
# along a specified direction vector. It can optionally create independent
# entities, meaning the new copies are not linked to the original geometry.
# Arguments:
# 1. List: Entities to translate (e.g., surfaces, solids).
# 2. Vector: Direction vector defining the translation path.
# 3. Integer: Number of translations to perform.
# 4. Boolean: Whether to make the new entities independent from the original.
# Geometry to translate
box_geom_entity = createBox(
"Volume",
Point(0, 0, 0),
Double(1),
Double(1),
Double(1)
)
# Translation parameters
direction = Vector(1, 0, 0) # Direction of translation
num_translations = 1 # Number of translated copies
independent = True # If True, creates independent entities
# Execute the multiple translations
multiTranslate(
[box_geom_entity],
direction,
num_translations,
independent
)
# Result:
# The original geometry is duplicated the specified number of times
# along the given direction. If 'independent' is True, the resulting
# geometries are not linked to the original one.
- rotate(entity, Axis, Angle)
Rotate: Rotate the geometric entity around an axis
Constraints: 3 dimensions- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Axis (POCCGeomLine) – Axis: Axis of rotation. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
Angle (Double) – Angle: Angle of rotation.
- rotate(entity, Center, Angle)
Rotate: Rotate the geometric entity around an axis
Constraints: 2 dimensions- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Center (Point) – Central point: Central point of rotation.
Angle (Double) – Angle: Angle of rotation.
- rotate(entity, GeomName, Axis, Angle)
Rotate: Rotate the geometric entity around an axis
Constraints: 3 dimensions- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
GeomName (str) – Name. Conditions: “” input must be non-empty.
Axis (POCCGeomLine) – Axis: Axis of rotation. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
Angle (Double) – Angle: Angle of rotation.
- rotate(entity, GeomName, Center, Angle)
Rotate: Rotate the geometric entity around an axis
Constraints: 2 dimensions- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
GeomName (str) – Name. Conditions: “” input must be non-empty.
Center (Point) – Central point: Central point of rotation.
Angle (Double) – Angle: Angle of rotation.
Example:
# -*- coding: utf-8 -*-
# Example: Rotating a geometric entity around an axis
# This command performs a rotation of one or more geometric entities
# around a specified axis. The rotation is defined by an angle.
# The command does not have referenced/non-referenced modes, since the entities
# themselves are directly provided.
# Define the rotation angle
rotation_angle = Double(180) # Rotation angle in degrees
# Create the entity to be rotated (example: a quad)
quad_geom_entity = createQuad(
"Surface",
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)
)
# Define the rotation axis
axis_rotation_geom_entity = createAxis(
"Curve",
Point(0, 0, 0), # Axis origin
Vector(1, 0, 0) # Axis direction
)
# Perform the rotation
rotate(
[quad_geom_entity], # List of entities to rotate
"Copy of Surface", # Name of the resulting rotated entity
axis_rotation_geom_entity, # Axis entity around which to rotate
rotation_angle # Rotation angle in degrees
)
# Result:
# A copy of the original quad is created, rotated around the specified axis
# by the defined angle.
- scale(entity, Center, Factor)
Proportional: Scale the geometric entity proportionally in all its dimensions
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Center (POCCVertexByCoord) – Central point: Central point of scale. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
Factor (Double) – Factor: Scale factor. Conditions: Value must be greater than 0.
- scale(entity, GeomName, Center, Factor)
Proportional: Scale the geometric entity proportionally in all its dimensions
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
GeomName (str) – Name. Conditions: “” input must be non-empty.
Center (POCCVertexByCoord) – Central point: Central point of scale. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
Factor (Double) – Factor: Scale factor. Conditions: Value must be greater than 0.
- scale(entity, Center, FactorX, FactorY, FactorZ)
Non Proportional: Scale the geometric entity with different scale factors for each of its dimensions
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
Center (POCCVertexByCoord) – Central point: Central point of scale. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
FactorX (Double) – Factor X: Scale factor in X direction. Conditions: Value must be greater than 0.
FactorY (Double) – Factor Y: Scale factor in Y direction. Conditions: Value must be greater than 0.
FactorZ (Double) – Factor Z: Scale factor in Z direction. Conditions: Value must be greater than 0.
- scale(entity, GeomName, Center, FactorX, FactorY, FactorZ)
Non Proportional: Scale the geometric entity with different scale factors for each of its dimensions
- Parameters:
entity ([Entity]) – Entity/Entities to apply the command
GeomName (str) – Name. Conditions: “” input must be non-empty.
Center (POCCVertexByCoord) – Central point: Central point of scale. Conditions: The input must be non-empty. “” does not exist in the dropdown list.
FactorX (Double) – Factor X: Scale factor in X direction. Conditions: Value must be greater than 0.
FactorY (Double) – Factor Y: Scale factor in Y direction. Conditions: Value must be greater than 0.
FactorZ (Double) – Factor Z: Scale factor in Z direction. Conditions: Value must be greater than 0.
Example:
# -*- coding: utf-8 -*-
# Example: Scaling a geometric entity
# This command creates a scaled copy of one or more geometric entities.
# The scaling is performed relative to a specified center point, using
# a scale factor. The command does not have referenced/non-referenced modes.
# Define the scale factor
scale_factor = 1 # Factor by which the geometry is scaled (1 = no change)
# Create the geometry to be scaled (example: a quad)
object_geom_entity = createQuad(
"Surface",
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)
)
# Define the center point for scaling
center_scale_point_geom_entity = createPoint(
"Point",
Point(0, -2, 0)
)
# Perform the scaling
scale(
[object_geom_entity], # List of entities to scale
"Copy of Surface", # Name of the resulting scaled entity
center_scale_point_geom_entity, # Center point of the scaling operation
scale_factor # Scale factor
)
# Result:
# A copy of the original geometry is created, scaled by the specified factor
# relative to the given center point.